package com.flowerplus.store.app.photo.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by hcqi on.
 * Des:图片item model
 * Date: 2017/3/31
 */

public class ImageItem implements Parcelable {

    private String imageId;//图像ID
    private String imagePath;//图像路径
    private String imageDate;
    private boolean isSelected = false;//是否被选择
    private boolean isOriginal = false;//是否发送选图
    private ImageBucket bucket;//持有一个相册类引用

    public String getImageDate() {
        return imageDate;
    }

    public void setImageDate(String imageDate) {
        this.imageDate = imageDate;
    }

    public String getImageId() {
        return imageId;
    }

    public void setImageId(String imageId) {
        this.imageId = imageId;
    }

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    public ImageBucket getBucket() {
        return bucket;
    }

    public void setBucket(ImageBucket bucket) {
        this.bucket = bucket;
    }

    public boolean isOriginal() {
        return isOriginal;
    }

    public void setOriginal(boolean original) {
        isOriginal = original;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.imageId);
        dest.writeString(this.imagePath);
        dest.writeByte(this.isSelected ? (byte) 1 : (byte) 0);
        dest.writeByte(this.isOriginal ? (byte) 1 : (byte) 0);
    }

    public ImageItem() {
    }

    protected ImageItem(Parcel in) {
        this.imageId = in.readString();
        this.imagePath = in.readString();
        this.isSelected = in.readByte() != 0;
        this.isOriginal = in.readByte() != 0;
    }

    public static final Creator<ImageItem> CREATOR = new Creator<ImageItem>() {
        @Override
        public ImageItem createFromParcel(Parcel source) {
            return new ImageItem(source);
        }

        @Override
        public ImageItem[] newArray(int size) {
            return new ImageItem[size];
        }
    };
}